import request from "@/utils/request";

// 资源分页
export const resourceinfopage = (data: object) => {
  return request.post("/resource/info/page", data);
};

// 查询动态资源参数配置
export const resourceinfoDynamic = (id: string) => {
  return request.get("/resource/info/dynamic/"+ id);
};

// 查询动态资源参数配置
export const resourceinfoDynamicDoc = (id: string,docId:string) => {
  return request.get("/resource/info/dynamic/"+ id + '/' + docId);
};


// 资源编辑
export const resourceinfo = (id: string) => {
  return request.get("/resource/info/"+ id);
};

//新增资源
export const resourceinfosave = (data: object) => {
  return request.post("/resource/info/save",data);
};

//保存静态资源内容
export const resourceinfosaveText = (data: object) => {
  return request.post("/resource/info/save/text",data);
};


//保存文档中的动态资源配置
export const resourceinfoSaveDynamic = (data: object,id?:string) => {
  return request.post("/resource/info/save/dynamic/"+ id,data);
};

//保存动态资源配置
export const resourceinfoGeneralSaveDynamic = (data: object) => {
  return request.post("/resource/info/save/dynamic",data);
};

//修改静态资源内容
export const resourceinfoUpdate = (data: object) => {
  return request.post("/resource/info/update",data);
};

//按照主键删除资源
export const resourceinfoRemove = (data: Array<Number>) => {
  return request.post("/resource/info/remove",data);
};

//按照主键删除资源
export const documentResourceSave = (data: Array<Number>) => {
  return request.post("/document/resource/save",data);
};

// 任务文件下载
export const gmtTaskDownload = (taskId: string,fileName:string) => {
  return request.get("/gmtTask/download/"+ taskId + '/' + fileName);
};
